<?php

namespace App;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

class Message extends Model
{
    public $timestamps = false;
    protected $fillable = ['content','is_reply'];
    protected $hidden = ['reply_status'];
    protected $casts = [
        'is_reply'=>'integer',

    ];
    public function event(){
        return $this->hasOne('App\Event');
    }

    public function getCreatedDatetimeAttribute(){
        return Carbon::parse($this->attributes['created_datetime'])->format('Y-m-d H:i:s');
    }
}
